package com.robot.orders.client;

import com.alibaba.fastjson.JSON;
import com.robot.orders.client.impl.MerchantClientImpl;
import com.robot.orders.pojo.client.Company;
import com.robot.orders.pojo.client.Industry;
import com.robot.orders.pojo.client.Store;
import entity.PageResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

/**
 * @author lin
 */
@Component
@FeignClient(value = "robot-merchant", fallback = MerchantClientImpl.class)
public interface MerchantClient {
    /**
     * 店铺详情
     *
     * @param id
     * @return
     */
    @GetMapping(value = "store/third/findStoreById/{id}", produces = "application/json; charset=utf-8")
    public String thirdFindStoreById(@PathVariable String id);

    /**
     * 获取可用的商店
     * @param id
     * @return
     */
    @RequestMapping(value = "store/third/findEnableStoreById/{id}",method = RequestMethod.POST,produces = "application/json;charset=utf-8")
    public String findEnableStoreById(@PathVariable String id);


    /**
     * 增加MerchantMember
     *
     * @param merchantMember
     */
    @RequestMapping(value = "merchantMember/third/addMerchantMemberByMerchantMember", method = RequestMethod.POST, produces = "application/json; charset=utf-8")
    public void thirdAddMerchantMemberByMerchantMember(@RequestBody String merchantMember);

    /**
     * 修改MerchantMember
     *
     * @param merchantMember
     */
    @RequestMapping(value = "merchantMember/third/updateMerchantMemberByMerchantMember", method = RequestMethod.PUT, produces = "application/json; charset=utf-8")
    public void thirdUpdateMerchantMemberByMerchantMember(@RequestBody String merchantMember);

    /**
     * 删除MerchantMember
     *
     * @param id
     */
    @RequestMapping(value = "merchantMember/third/deleteMerchantMemberById/{id}", method = RequestMethod.DELETE, produces = "application/json; charset=utf-8")
    public void thirdDeleteMerchantMemberById(@PathVariable String id);

    /**
     * 通过storeId和memberId查找店铺名下的某一会员
     *
     * @param storeId
     * @param memberId
     * @return
     */
    @RequestMapping(value = "merchantMember/third/findMerchantMemberByStoreIdAndMemberId/{storeId}/{memberId}", method = RequestMethod.GET, produces = "application/json; charset=utf-8")
    public String thirdFindMerchantMemberByStoreIdAndMemberId(@PathVariable String storeId, @PathVariable String memberId);
}
